package com.tao.util;

import java.util.List;

import org.junit.Test;
import org.springframework.context.ApplicationContext;

import com.tao.dao.group.GroupDao;
import com.tao.domain.Group;
import com.tao.domain.PolMenu;
import com.tao.domain.SendMessage;
import com.tao.service.menu.PolMenuService;
import com.tao.service.message.SendMessageService;

public class Tests {
	
	

	@Test
	public void testDao() {
		ClassPathXmlApplicationContextTest  ctx = new ClassPathXmlApplicationContextTest();
		ApplicationContext applicationContext = ctx.getApplicationContext();
		  applicationContext.getBean("sessionFactory");
		  
		  Object[] objects = new Object[]{"1"};
//		  PolMenuService polMenuService = (PolMenuService) applicationContext.getBean("polMenuService",PolMenuService.class);
//			List<PolMenu> polList = polMenuService.list("from PolMenu where sub_id=?",objects);
//			System.out.println(polList);
		  //UserDao userDao = (UserDao) applicationContext.getBean("userDao",UserDao.class);
//		  GroupDao groupDao = (GroupDao) applicationContext.getBean("groupDao",GroupDao.class);
//			 
//		  Group  t = new Group();
//		  t.setUin("2190998410");
//		  
//		  groupDao.delete(t);
	    ///UserDao userDao = applicationContext.getBean(UserDao.class);
	 
		  SendMessageService polMenuService = (SendMessageService) applicationContext.getBean("sendMessageService",SendMessageService.class);
		  SendMessage s  =new SendMessage();
		 s.setSubName("dsfsdf");
		  polMenuService.add(s);
	}
	/*	
	@org.junit.Test
	public void testService() {
		ClassPathXmlApplicationContextTest  ctx = new ClassPathXmlApplicationContextTest();
		ApplicationContext applicationContext = ctx.getApplicationContext();
		UserService userService = applicationContext.getBean("userService",UserService.class);
	System.out.println(userService.selectAll());
	}
	
	@Test
	public void testAction() {
		ClassPathXmlApplicationContextTest  ctx = new ClassPathXmlApplicationContextTest();
		ApplicationContext applicationContext = ctx.getApplicationContext();
		LoginAction loginAction = applicationContext.getBean(LoginAction.class);
	loginAction.findName();
	}
	*/
	public static void main(String[] args) {
		
	}

}
